/*
 *  Copyright 2012 yura.
 * 
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 * 
 *       http://www.apache.org/licenses/LICENSE-2.0
 * 
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *  under the License.
 */

package org.opu.pc.ui.client;

import java.beans.PropertyChangeListener;
import java.util.Collection;
import java.util.List;
import javax.swing.JDialog;
import javax.swing.JFrame;
import org.opu.pc.services.beans.AbstractBean;
import org.opu.pc.ui.client.actions.AbstractAction;

/**
 * Main view - frame with menu, tollbr, and content panel
 * @author yura
 */
public interface MainView {

    public static final String CONTENT_TYPE = "content_type";
    public static final String SELECTED_BEANS = "selected_beans";
    public static final String LAST_ACTION_CHANGE = "laction_change";

    public void addChangeListener(PropertyChangeListener changeListener);

    /**
     * fire property change for all listener from null to current state
     */
    public void fireState();

    public JFrame asFrame();

    public JDialog getDialog();

    /**
     * Perform last action one more time
     */
    public void update();

    /**
     * Init menu and toolbar and ...
     */
    public void initActions(Collection<? extends AbstractAction> actions);

    /**
     * change content data
     */
    public void setContent(Collection<? extends AbstractBean> beans, Class<?> beansClass);

    /**
     * @return list of selected object. It will return null if no object was
     * selected.
     */
    public List<? extends AbstractBean> getSelectedBeans();

    public void strartAction(AbstractAction action);

    public void stopAction(AbstractAction action);

    public void cancelCurrentAction();

}
